package com.hmy.finance.api.bo.core.request.enums;


import lombok.Getter;

@Getter
public enum ReceiptedTypeEnum {

    BANK(10, "银行转账", "银行转账"),

    QR_CODE(20, "二维码", "二维码"),

    ACCEPTANCE_BILL(30, "承兑汇票", "承兑汇票"),

    OTHER(90, "其他", "其他");

    /**
     * 状态code
     */
    private Integer statusCode;

    /**
     * 前端显示状态
     */
    private String displayDesc;

    /**
     * 状态描述
     */
    private String statusDesc;


    ReceiptedTypeEnum(Integer statusCode, String displayDesc, String statusDesc) {
        this.statusCode = statusCode;
        this.displayDesc = displayDesc;
        this.statusDesc = statusDesc;
    }

    public static String getDisPlayDescByType(Integer type) {
        for (ReceiptedTypeEnum receiptedTypeEnum : ReceiptedTypeEnum.values()) {
            if (receiptedTypeEnum.getStatusCode().intValue() == type) {
                return receiptedTypeEnum.getDisplayDesc();
            }
        }
        return null;
    }

    public static ReceiptedTypeEnum getEnumByType(Integer type) {
        for (ReceiptedTypeEnum receiptedTypeEnum : ReceiptedTypeEnum.values()) {
            if (receiptedTypeEnum.getStatusCode().intValue() == type) {
                return receiptedTypeEnum;
            }
        }
        return null;
    }

}
